<template>
  <div class="app-container">
    <embed :src="src" type="text/xml" class="process-image">
  </div>
</template>

<script>
import { diagrams } from '@/api/workflow/workflow'
export default {
  name: 'Diagrams',
  data() {
    return {
      src: '',
      deploymentId: this.$route.query.deploymentId
    }
  },
  mounted() {
    this.diagrams()
  },
  methods: {
    diagrams() {
      diagrams(this.deploymentId).then(res => {
        this.src = URL.createObjectURL(new Blob([res], { type: 'text/xml' }))
      }).catch(err => {
        console.log(err)
      })
    }
  }
}
</script>

<style scoped>
.process-image{
  width: 100%;
  height: 800px;
}
</style>
